 package xin.petstore.framework.orm.mybatis.paginator.springmvc;
 
 import xin.petstore.framework.orm.mybatis.paginator.domain.Order;
 import xin.petstore.framework.orm.mybatis.paginator.domain.PageBounds;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 public class PageForm
 {
   public static final String CHINESE_PINYIN = "nlssort(? ,'NLS_SORT=SCHINESE_PINYIN_M')";
   private int page = 1;
   private int limit = 30;
   private String sort;
   private Map<String, Object> paramMap = new HashMap();
 
   private Map<String, String> orderExprs = new HashMap();
 
   public int getPage() {
     return this.page;
   }
 
   public void setPage(int page) {
     this.page = page;
   }
 
   public int getLimit() {
     return this.limit;
   }
 
   public void setLimit(int limit) {
     this.limit = limit;
   }
 
   public String getSort() {
     return this.sort;
   }
 
   public void setSort(String sort) {
     this.sort = sort;
   }
 
   public Map<String, Object> getParamMap() {
     return this.paramMap;
   }
 
   public void setParamMap(Map<String, Object> paramMap) {
     this.paramMap = paramMap;
   }
 
   public void addOrderExpr(String property, String expr) {
     this.orderExprs.put(property, expr);
   }
 
   public PageBounds toPageBounds() {
     List orders = Order.formString(this.sort);
     for (int i = 0; i < orders.size(); i++) {
       Order order = (Order)orders.get(i);
       if (this.orderExprs.get(order.getProperty()) != null) {
         orders.set(i, 
           new Order(order.getProperty(), 
           order.getDirection(), 
           (String)this.orderExprs.get(order.getProperty())));
       }
     }
 
     return new PageBounds(this.page, this.limit, orders);
   }
 }
